#include "stu.h"
 
 int main()
 {
     int input = 0;
     int ret = 0;
     //1.创建班级
     cla_t* cla = (cla_t*)malloc(sizeof(cla_t));
     if(cla == NULL)
     {
         printf("班级创建失败！");
         return -1;
     }
     cla->num = -1;  //初始化班级人数（0-29）
     //2.实现功能
     do
     {
         menu();
         printf("请选择 >");
         scanf("%d", &input);
         switch(input)
         {
        case ADD:
            add_stu(cla);
            break;
        case DEL:
            ret = del_stu(cla);
            printf("%d个学生被删除成功了\n",ret);
            break;
        case MOD:
            mod_stu(cla);
            printf("修改学生信息成功\n");
            break;
        case CHE:
            ret = che_stu(cla);
            printf("共查询到%d个学生", get_num_bit(ret));
            break;
        case SOR:
            sort_student(cla);
            break;
        case SHOW:
            show_student(cla);
            break;
        case EXIT:
            printf("已退出！\n");
            break;
        default:
            printf("输入有误，请重新输入！\n");
            break;
         }

     }while(input);

    //释放空间
    if(cla != NULL)
    {
        free(cla);
        cla = NULL;
    }

     return 0;
 }